package com.simulate2.demo.quartz;

import com.simulate2.demo.DemoApplication;
import com.simulate2.demo.dao.CommisionRepository;
import com.simulate2.demo.dao.OrderDao;
import com.simulate2.demo.dao.UserRepository;
import com.simulate2.demo.service.MongoDbService;
import com.simulate2.demo.service.OrderService;
import javafx.application.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.ScriptOperations;
import org.springframework.test.context.junit4.SpringRunner;

import java.math.BigDecimal;
import java.util.Date;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = DemoApplication.class)
public class test {

    @Autowired
    UserRepository userRepository;
    @Autowired
    OrderDao orderDao;
    @Autowired
    OrderService orderService;
    @Autowired
    CommisionRepository commisionRepository;
    @Autowired
    MongoDbService mongoDbService;


    @Test
    public void test() {

        Date date5 = new Date();                    //获得当前时间
        System.out.println("核算1000 0000订单的总佣金，并计算1000 0000用户的每人分拥，所需时间---->开始时间："+date5);
        orderService.caluOrdersByDay(20200122);
        Date date6 = new Date();                    //获得当前时间
        System.out.println("结束时间："+date6+"  共耗时："+(date6.getTime()-date5.getTime()));

    }
}
